package com.hzwq.demo.Email.repository;

import com.hzwq.demo.Email.bo.SdteInBox;
import com.hzwq.demo.Login.bo.SdteUser;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/***
 * 收件箱
 */
@Repository
public interface SdteInBoxRepository extends CrudRepository<SdteInBox, Long>, JpaSpecificationExecutor {

    /**
     * 根据
     * @param id
     * @return
     */
    @Query(value = "select t.receive_id,\n" +
            "       t.inbox_sender,\n" +
            "       t.inbox_title,\n" +
            "       t.inbox_date,\n" +
            "       t.inbox_receiver,\n" +
            "       t.inbox_content,\n" +
            "       t.receive_state,\n" +
            "       t.email_state from sdte_inbox t \n" +
            "       where t.inbox_receiver = ?1",nativeQuery = true)
    public List<SdteInBox> findListEmalByReceiveId(String id);

}